sqoop import \
--connect jdbc:mysql://node101:3306/jtp_vivo_log \
--username root \
--password 123456 \
--query 'SELECT user_id, register_date, age, gender, vip_level, vip_expire_date, phone_brand, phone_model, os_version, first_login_date, last_login_date, province, city, district, is_active, user_tag, update_time FROM jtp_vivo_log.vivo_user_info WHERE $CONDITIONS AND 1 = 1;' \
--delete-target-dir \
--target-dir 'hdfs://node101:8020/warehouse/vivo_app_warehouse/vivo_user_info/2025-07-25' \
--as-textfile \
--fields-terminated-by '\001' \
--num-mappers 1 \
--null-string '\\N' \
--null-non-string '\\N'


sqoop import \
--connect jdbc:mysql://node101:3306/jtp_vivo_log \
--username root \
--password 123456 \
--query 'SELECT device_id, user_id, device_type, device_model, manufacture_date, purchase_date, screen_size, resolution, memory_size, storage_size, os_type, os_version, network_type, is_rooted, update_time FROM jtp_vivo_log.vivo_device_info WHERE $CONDITIONS AND 1 = 1;' \
--delete-target-dir \
--target-dir 'hdfs://node101:8020/warehouse/vivo_app_warehouse/vivo_device_info/2025-07-25' \
--as-textfile \
--fields-terminated-by '\001' \
--num-mappers 1 \
--null-string '\\N' \
--null-non-string '\\N'

for i in vivo_device_info vivo_app_info vivo_location_info vivo_user_info
do
/opt/module/sqoop/bin/sqoop import --connect jdbc:mysql://node101:3306/jtp_vivo_log  \
    --username root  --password 123456 \
    --delete-target-dir \
    -m 1 \
    --table $i \
    --target-dir /warehouse/vivo_app_warehouse/$i/2025-07-26 \
    -z \
    --compression-codec gzip \
    --null-string '\\N' --null-non-string '\\N' \
    --fields-terminated-by '\001'
done




for i in vivo_device_info vivo_app_info vivo_location_info vivo_user_info
do
/opt/module/sqoop/bin/sqoop import --connect jdbc:mysql://node101:3306/jtp_vivo_log  \
    --username root  --password 123456 \
    --delete-target-dir \
    -m 1 \
    --table $i \
    --target-dir /warehouse/vivo_app_warehouse/$i/2025-07-27 \
    -z \
    --compression-codec gzip \
    --null-string '\\N' --null-non-string '\\N' \
    --fields-terminated-by '\001'
done
